import React, { Suspense } from "react";
import { BrowserRouter } from "react-router-dom";
import { renderRoutes } from "react-router-config";
import { History } from "history";
import routes from "./routes";
import { Spin } from 'antd';

interface IAppProps {
  history: History;
}

const App: React.FC<IAppProps> = () => {
  return (
    <BrowserRouter>
      <Suspense fallback={<Spin />}>{renderRoutes(routes)}</Suspense>
    </BrowserRouter>
  );
};

export default App;
